<%@ tag body-content="empty" pageEncoding="utf-8" description="HTMLSelect출력" %>
<%@ attribute name="id"%>
<%@ attribute name="cssClass"%>
<%@ attribute name="onchange"%>
<%@ attribute name="selectedId"%>
<%@ attribute name="nullMsg"%>
<%@ attribute name="init"%>
<%@ attribute name="codeList" type="java.util.List"%>
<%@ attribute name="addList" type="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<select id="${id}" name="${id}" class="${cssClass}" onchange="${onchange}">
	<c:if test="${init eq 'all' }">
			<option value="all"  <c:if test="${selectedId eq list.code_vl}">selected</c:if>>
				:::전체:::
			</option>
	</c:if>
	<c:if test="${init eq 'null' }">
			<option value=""  <c:if test="${selectedId eq list.code_vl}">selected</c:if>>
				:::선택하세요:::
			</option>
	</c:if>
	<c:if test="${ not empty codeList }">
		<c:forEach items="${codeList}" var="list">
		
			<c:if test="${ empty list.code_dc }">
			<option value="${list.code_vl}" <c:if test="${selectedId eq list.code_vl}">selected</c:if>>
				${list.code_nm}
			</option>
			</c:if>
			<c:if test="${ not empty list.code_dc }">
			<option value="${list.code_vl}" <c:if test="${selectedId eq list.code_vl}">selected</c:if>>
				${list.code_nm}(${list.code_dc})
			</option>
			</c:if>
		
		</c:forEach>
	</c:if>
	<c:if test="${empty codeList }">
			<option value="none" >
				${nullMsg}
			</option>
	</c:if>
</select>